#pragma once
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>

class UtilityString
{
public:
	UtilityString(void);
	UtilityString(const char* str1);
	UtilityString(const wchar_t* wStr1);
	UtilityString(const UtilityString& uStr1);
	virtual ~UtilityString(void);
	UtilityString& UtilityString::operator=(UtilityString& rhs ) {
		m_iStrLens = rhs.GetStrLens();
		SetCharStr(rhs.GetCharStr());
		return *this;
	}
	void SetCharStr(const char* str1);
	void SetWCharStr(const wchar_t* wStr1);
	inline const char* GetCharStr() const {return static_cast<const char*>(m_strContent);}
	inline size_t GetStrLens() const {return m_iStrLens;}
	const wchar_t* GetWCharStr();
	void ConcatenateStr(const char* str1);
	void ConcatenateWStr(const wchar_t* wStr1);
	void ConcatenateUtilityStr(UtilityString& uStr1);
	//utility
	void replaceExt(const char* strExt);
	void extractFNWithoutExt(UtilityString& uStr);
	void extracFNOnly(UtilityString& uStr);
	int SearchSubStringFirstOccurrence(const char* str1);
	int Remove1LevelSubDirectory();
	int GetFileNameFromFullPath(UtilityString& strFN);
	int GenerateFormatSmallString(const char* format, ...);

protected:
	char* m_strContent;
	wchar_t* m_wstrContent;
	size_t  m_iStrLens;

private:
	void RelocateMemory(size_t iNewSize);
};

